package com.jiancong.mapper;

import com.jiancong.domain.dto.UserQueryCriteria;
import com.jiancong.domain.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    User selectOne(String username);

    User getById(Long id);

    void updateById(User user);

    List<User> selectByNickName(String nickName);

    List<User> selectByUserName(String userName);

    List<User> selectByUserEmail(String userEmail);

    void save(@Param("user")User user);

    List<User> selectUsersByCriteria(@Param("criteria") UserQueryCriteria criteria);

    int insertUser(@Param("user") User user);

    int updateUserStatus(@Param("id") Long id, @Param("delFlag") String delFlag);

    User selectUserById(@Param("id") Long id);

    int updateUser(@Param("user") User user);

    void updateIsAuthorById(@Param("user") User user);

    void insertUserRole(@Param("userId")Long userId, @Param("roleId") Long roleId);
}
